<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

		<h3 style="text-align: center;">黑马书籍商城--购物车</h3>
		<p style="text-align: center;">
			欢迎尊贵的铂金会员
			<span style="color: red;">
			 	${existUser.name}
			</span> 
			<a href="${pageContext.request.contextPath}/BookServlet?method=findAll">首页</a>
			<a href="${pageContext.request.contextPath}/CartServlet?method=findAll">购物车</a>
			<a href="${pageContext.request.contextPath}/LogoutServlet">[退出登录]</a>
		</p>
		<center style="color:red;font-size:20px">
			${tip}
		</center>
		<hr />		
		<table border="1" align="center">
			<thead>
				<tr>
					<th>书籍名称</th>
					<th>单价</th>
					<th>购买数量</th>
					<th>总价</th>
					<th>备注</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="cart" items="${cartList}">		
				<tr>
					<td>${cart.bookName }</td>
					<td>${cart.bookPrice }</td>
					<td>${cart.bookCount }</td>
					<td>${cart.bookPrice * cart.bookCount }</td>
					<td>${cart.c_desc }</td>
					<td>
						<a href="${pageContext.request.contextPath}/CartServlet?method=delete&cid=${cart.cid }">移除购物车</a>	
					</td>
				</tr>
				</c:forEach>			
			</tbody>
		</table>
		
</body>
</html>